package com.itheima;

public class Demo03Equals {
    public static void main(String[] args) {
        String s1 = new String("abc");
        String s2 = new String("abc");

        String s3 = "abc";
        String s4 = "abc";

        System.out.println(s1 == s2);  //false
        System.out.println(s2 == s3);  //false
        System.out.println(s3 == s4);  //true

        boolean equals = s1.equals(s2);  //true
        boolean equals1 = s1.equals(s3); //true
        boolean equals2 = s2.equals(s4); //true

        System.out.println(equals);
        System.out.println(equals1);
        System.out.println(equals2);
        System.out.println(s1.equals(s4));


    }
}
